package com.dingyh.shopwebbackground.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.dingyh.shopwebbackground.entity.Advice;
import com.dingyh.shopwebbackground.mapper.AdviceMapper;
import com.dingyh.shopwebbackground.service.AdviceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author dingyuhan
 * @since 2023-02-17
 */
@Service
public class AdviceServiceImpl extends ServiceImpl<AdviceMapper, Advice> implements AdviceService {
    @Autowired
    AdviceMapper adviceMapper;

    public List<Advice> getAllWrite(Map<String,Object> map){
        return  baseMapper.getAllWrite(map);
    }

    public  boolean removeWrite(String id){
        try {
            return removeById(id);
        }catch (Exception e){
            System.out.println(e);
            return false;
        }
    }

    public List<Advice> selectWriteById(Map<String,Object> map){
        return adviceMapper.selectWriteById(map);
    }

    public List<Advice> selectWriteByName(Map<String,Object> map){
        return adviceMapper.selectWriteByName(map);
    }
}
